package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.ReturnSalesMapper;
import com.ruoyi.crm.domain.ReturnSales;
import com.ruoyi.crm.service.IReturnSalesService;

/**
 * 销售退货单Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-27
 */
@Service
public class ReturnSalesServiceImpl implements IReturnSalesService
{
    @Autowired
    private ReturnSalesMapper returnSalesMapper;

    /**
     * 查询销售退货单
     *
     * @param id 销售退货单主键
     * @return 销售退货单
     */
    @Override
    public ReturnSales selectReturnSalesById(String id)
    {
        return returnSalesMapper.selectReturnSalesById(id);
    }

    /**
     * 查询销售退货单列表
     *
     * @param returnSales 销售退货单
     * @return 销售退货单
     */
    @Override
    public List<ReturnSales> selectReturnSalesList(ReturnSales returnSales)
    {
        return returnSalesMapper.selectReturnSalesList(returnSales);
    }

    /**
     * 新增销售退货单
     *
     * @param returnSales 销售退货单
     * @return 结果
     */
    @Override
    public int insertReturnSales(ReturnSales returnSales)
    {
        return returnSalesMapper.insertReturnSales(returnSales);
    }

    /**
     * 修改销售退货单
     *
     * @param returnSales 销售退货单
     * @return 结果
     */
    @Override
    public int updateReturnSales(ReturnSales returnSales)
    {
        returnSales.setUpdateTime(DateUtils.getNowDate());
        return returnSalesMapper.updateReturnSales(returnSales);
    }

    /**
     * 批量删除销售退货单
     *
     * @param ids 需要删除的销售退货单主键
     * @return 结果
     */
    @Override
    public int deleteReturnSalesByIds(String[] ids)
    {
        return returnSalesMapper.deleteReturnSalesByIds(ids);
    }

    /**
     * 删除销售退货单信息
     *
     * @param id 销售退货单主键
     * @return 结果
     */
    @Override
    public int deleteReturnSalesById(String id)
    {
        return returnSalesMapper.deleteReturnSalesById(id);
    }

    @Override
    public ReturnSales getInfoByReturnNo(String returnNo) {
        return returnSalesMapper.getInfoByReturnNo(returnNo);
    }
}